def RemoveDupli[A](l: List[A]): List[A] = l match {
    case Nil       => Nil
    case head :: tail => head :: RemoveDupli(tail.dropWhile(_ == head))
  }
  
  //this program removes duplicate elements from a list retaining one copy of each element.
  //such logic can be further used in removing redundant steps in a proof.